﻿<%@ Page Title="" Language="C#" MasterPageFile="~/OfficeMasterPage.Master" AutoEventWireup="true"
    CodeBehind="FrmListProdutos.aspx.cs" Inherits="EstoqueUnifeiADO.FrmListProdutos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="Controles/ctrlItemProduto.ascx" TagName="ctrlItemProduto" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table style="width: 98%">
        <tr>
            <td>
            <asp:ObjectDataSource ID="odsView" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetData" TypeName="EstoqueUnifeiADO.Dados.dsProdutosTableAdapters.VIEWPRODUTOTableAdapter"
                    DeleteMethod="Delete" OnDeleted="odsView_Deleted">
                    <DeleteParameters>
                        <asp:Parameter Name="Original_CODPRODUTO" Type="Int32" />
                    </DeleteParameters>
                </asp:ObjectDataSource>
                <asp:ValidationSummary ID="vsForm" runat="server" BorderColor="Red" 
                    BorderStyle="Solid" BorderWidth="2px" ForeColor="Red"  />
                <br />
                <asp:HiddenField ID="hfKey" runat="server" />
                <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" Width="98%" 
                    onmenuitemclick="Menu1_MenuItemClick">
                    <Items>
                        <asp:MenuItem ImageUrl="~/images/Icones/application_form_add.png" Text="Novo" 
                            Value="Novo" ></asp:MenuItem>
                    </Items>
                </asp:Menu>
            </td>
        </tr>
        <tr>
            <td>
                
               <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" DataKeyNames="CODPRODUTO"
                            DataSourceID="odsView" Width="98%" AllowPaging="True" 
                    AllowSorting="True" CellPadding="4"
                            ForeColor="#333333" GridLines="None" PageSize="25" 
                    onrowcommand="gvList_RowCommand" 
                    onselectedindexchanged="GridView1_SelectedIndexChanged">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/Icones/application_form_magnify.png"
                                            CommandName="Select" ToolTip="Visualizar registro" CommandArgument="View" />
                                        <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/Icones/application_form_edit.png"
                                            CommandName="Select" ToolTip="Alterar registro" CommandArgument="Edit" />
                                        <asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/images/Icones/delete.png"
                                            CommandName="Delete" ToolTip="Excluir registro" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="CODPRODUTO" HeaderText="Código" InsertVisible="False"
                                    ReadOnly="True" SortExpression="CODPRODUTO" />
                                <asp:BoundField DataField="TIPOCODIGO" HeaderText="Tipo de produto" SortExpression="TIPOCODIGO" />
                                <asp:BoundField DataField="TITULO" HeaderText="Título" SortExpression="TITULO" />
                                <asp:BoundField DataField="ELEMENTODESPESA" HeaderText="Elemento de despesa" SortExpression="ELEMENTODESPESA" />
                                <asp:BoundField DataField="QUANTIDADE" HeaderText="Quantidade atual" SortExpression="QUANTIDADE" />
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="Button1" runat="server" Text="Button" style="display:none" />
                <asp:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server" DynamicServicePath=""
                    Enabled="True" TargetControlID="Button1" BackgroundCssClass="modalBackground"
                    PopupControlID="pnlEdit">
                </asp:ModalPopupExtender>
                <br />
                <asp:Panel ID="pnlEdit" runat="server" BackColor="White" Width="400px">
                    <table style="width: 100%">
                        <tr style="text-align: right">
                            <td>
                                <asp:Button ID="Button2" runat="server" Text="X" ToolTip="Sair" OnClick="Button2_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <uc1:ctrlItemProduto ID="ctrlItem" runat="server" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>
